
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增项目')" />
    <th:block th:include="include :: datetimepicker-css" />

    <style>
        .box1 {
            margin: 0px auto;
            width: 100%;

        }

        * {
            margin: 0;
            padding: 0;
        }

        .time-input{
            display: block;
            padding-left: 10px;
            float: left;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: transparent;
            outline: none;
            height: 30px;
            width: 100px;
            padding-left: 5px;
        }

    </style>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-project-add">
            <div class="row">



                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>企业名称：</label>
                        <div class="col-sm-8">
                            <input name="companyName" id="companyName" class="form-control" type="text" required>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>项目名称：</label>
                        <div class="col-sm-8">
                            <input name="proName" id="proName" class="form-control" type="text" required>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">企业联系人：</label>
                        <div class="col-sm-8">
                            <input name="leader" id="leader" class="form-control" type="text" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>法人手机号：</label>
                        <div class="col-sm-8">
                            <input name="leaderPhone" id="leaderPhone" class="form-control" type="text"  maxlength="11" required>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 手机号作为企业登录系统账号，请填写真实号码</span>
                        </div>
                    </div>
                </div>
                <input name="password"  type="hidden" th:value="${@config.getKey('sys.user.initPassword')}" >
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">项目投资：</label>
                        <div class="col-sm-8">
                            <input name="investmentAmount" id="investmentAmount" class="form-control" type="text" >
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" >
                    <div class="form-group">
                        <label class="col-sm-4 control-label">项目标签：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input name="proTag" id="treeId" class="form-control" type="hidden">
                                <input class="form-control" type="text" onclick="selectProjectTagTree()" id="treeName" readonly="true" th:value="${lkProjectTag?.tabName}">
                                <span class="input-group-addon"><i class="fa fa-search"></i></span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">移交日期：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                <input name="transitionTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">时间节点：</label>
                        <div class="col-sm-8">


                            <div class="input-group date select-time" >
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
                                <span style="float: left">-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
                                <!--<input name="onlineTime" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
                                <!--<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[startTime]"/>-->
                                <!--<span style="float: left">-</span>-->
                                <!--<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>-->
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">项目类型：</label>
                        <div class="col-sm-8">
                            <select name="proType" id="proType" class="form-control m-b" th:with="type=${@dict.getType('project_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>

                        </div>
                    </div>
                </div>

<!--                <div class="col-sm-6" >-->
<!--                    <div class="form-group">-->
<!--                        <label class="col-sm-4 control-label">项目状态：</label>-->
<!--                        <div class="col-sm-8">-->
<!--                            <select name="proStage"  class="form-control m-b" th:with="type=${@dict.getType('project_stage')}">-->
<!--                                <option value="">所有</option>-->
<!--                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                            </select>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
                <div class="col-sm-6" >
                    <div class="form-group">
                        <label class="col-sm-4 control-label">办理事项模板</label>
                        <div class="col-sm-8">
                            <select name="templateId"  id="templateId" class="form-control m-b" >
                                <option value="">所有</option>
                                <option  th:each="temp : ${temps}" th:text="${temp.tempName}" th:value="${temp.tempId}" th:data_m_ids="${temp.matterIds}"></option>
                            </select>
                            <!--<input name="proMatterIds" class="form-control" type="text">-->
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">项目地址：</label>
                        <div class="col-sm-8">
                            <input name="proAddress" id="proAddress" class="form-control" type="text" oninput="addressSearch()">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" >
                    <div class="form-group">
                        <label class="col-sm-4 control-label">简介：</label>
                        <div class="col-sm-8">
                            <textarea name="remark" class="form-control"></textarea>
                        </div>
                    </div>
                </div>



<!--                <div class="col-sm-6">-->
<!--                    <div class="form-group">-->
<!--                        <label class="col-sm-4 control-label">经度：</label>-->
<!--                        <div class="col-sm-8">-->
<!--                            <input disabled name="proLng" id="proLng" class="form-control" type="text" >-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

<!--                <div class="col-sm-6">-->
<!--                    <div class="form-group">-->
<!--                        <label class="col-sm-4 control-label">纬度：</label>-->
<!--                        <div class="col-sm-8">-->
<!--                            <input disabled name="proLat" id="proLat" class="form-control" type="text" >-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->

                <div id="containerMap" style="width: 100%; height: 300px"></div>

                <!--refundFlag-->




                <input name="proMatterIds" id="proMatterIds" class="form-control" type="hidden">
                <input name="proLng" id="proLng" class="form-control" type="hidden" >
                <input name="proLat" id="proLat" class="form-control" type="hidden" >


            </div>
<!--            <input name="companyId" class="form-control" type="hidden" id="companyId" required>-->
<!--            <input name="companyName" class="form-control" type="hidden" id="companyName" required>-->
            <input type="hidden" name="proTypeName" id="proTypeName">


            <!--<div class="form-group">    -->
                <!--<label class="col-sm-3 control-label">项目状态：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<div class="radio-box">-->

                        <!--<div class="radio-box" th:each="dict : ${@dict.getType('project_status')}">-->
                            <!--<input type="radio" th:id="${dict.dictCode}" name="proStatus" th:value="${dict.dictValue}" >-->
                            <!--<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
                        <!--</div>-->
                        <!--&lt;!&ndash;<select name="proStatus" class="form-control m-b">&ndash;&gt;-->
                            <!--&lt;!&ndash;<option value="">所有</option>&ndash;&gt;-->

                        <!--&lt;!&ndash;</select>&ndash;&gt;-->
                        <!--&lt;!&ndash;<input type="radio" name="proStatus" value="">&ndash;&gt;-->
                        <!--&lt;!&ndash;<label th:for="proStatus" th:text="未知"></label>&ndash;&gt;-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->

        </form>

        </div>
    <!--</div>-->
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=zaF87OcStYCRWUflA3U8IGA85PfV3MEO" ></script>
    <script th:inline="javascript">
        var datas = [[${@dict.getType('project_tag')}]];
        var map;
        map = new BMap.Map("containerMap",{enableMapClick:false});
        map.enableScrollWheelZoom();
        var point = new BMap.Point(115.864, 28.689);
        map.centerAndZoom(point, 15);
        var geoc = new BMap.Geocoder();
        var local = new BMap.LocalSearch(map, {
            renderOptions:{map: map}
        });

        // 点击地图获取地址
        map.addEventListener("click", function(e){
            map.clearOverlays();
            var pt = e.point;
            $("input[name='proLng']").val(e.point.lng)
            $("input[name='proLat']").val(e.point.lat)
            var marker = new BMap.Marker(new BMap.Point(e.point.lng, e.point.lat)); // 创建点
            map.addOverlay(marker);
            geoc.getLocation(pt, function(rs){
                var addComp = rs.addressComponents;
                $("input[name='proAddress']").val(addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber)
            });
        });
        // 搜索地址
        function addressSearch(){
            map.clearOverlays();
            var address = $("input[name='proAddress']").val();
            local.search(address);
            geoc.getPoint(address, function(point){
                if (point) {
                    $("input[name='proLng']").val(point.lng)
                    $("input[name='proLat']").val(point.lat)
                }
            })
        }

    </script>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <!--<script th:src="@{/jade/js/select.js}"></script>-->
    <script th:src="@{/jade/js/project_add.js}"></script>




</body>
</html>